home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 333_02 / p016.awk < prev    next >
Encoding:
Text File  |  1989-04-21  |  231 b   |  10 lines

  1.  
  2. # interest2 - compute compound interest
  3. #   input:    amount rate years
  4. #   output:    compounded value at the end of each year
  5.  
  6.     {
  7.     for (i = 1; i <= $3; i = i + 1)
  8.         printf("Year %d\t%.2f\n", i, $1 * (1 + $2) ^ i)
  9.     }
  10.